﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DBConstruct;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Collections;
using DBConstruct;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        DBAccessor dba = new DBAccessor();
        string connectionString = @"Data Source=DRAGON_Q-PC\SQL2005;Initial Catalog=PokemonCollection;User ID=sa;Password=587247";
        dba.DBAccessDriver(connectionString, DBType.SQLType);

    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        int count = 1;
        string cmd = "select * from [PokemonPrimaryInformation]";
        DataSet ds = DBAccessor.QueryDataSetNonParams(cmd);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        cmd = "select * from [PokemonPrimaryInformation] where [GlobalNumber]='No.001'";
        //SqlParameter[] params_ = { new SqlParameter("@GlobalNumber", "No.001"), new SqlParameter("@PokemonChineseName", "妙蛙种子") };
        if(DBAccessor.QueryExistNonParams(cmd))
            Response.Write("OK");
        else
            Response.Write("No");
        

    }
}
